#include "wds_bullet_flame.h"


WDSBulletFlame::WDSBulletFlame(float Speed, WDSSfx::SFX_TYPES	SfxType) : WDSBulletSfx(Speed,SfxType),
																		   m_Scale(1.0f)
{
	m_IsTypeGauss = true;
	m_DamagePower = 0.05f;
}

void			WDSBulletFlame::Tick(float dt, float SkillBulletSpeed, const math::Vec2& Offset)
{
	if(!m_IsAlive)
		return;

	if(m_LifeDuration > 0)
		m_LifeDuration -= dt;

	if(m_LifeDuration <= 0)
	{
		m_IsAlive = false;		
	}
	float Speed = m_Movement.GetSpeed();
	if(Speed > 0.05f)
		Speed -= ( dt * 0.2f);
	m_Movement.SetMoveSpeed(Speed);

	m_Scale += ( dt * 1.25f ) ;
	if(m_Scale >= 1.5f)
		m_Scale = 1.5f;

	if(m_pSfx)
		m_pSfx->SetScale(m_Scale);
	WDSBulletSfx::Tick(dt, SkillBulletSpeed, Offset);
}

void			WDSBulletFlame::ReSpawn(const math::Vec2& Pos,
								WDSBullet::STARTPOS StartDir,
								float Degree								
								)
{
	m_LifeDuration = 1.0f;
	WDSBulletSfx::ReSpawn(Pos,StartDir,Degree);
	m_Scale = 0.5f;
	m_pSfx->SetScale(m_Scale);
}